package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.RegisterDto;
import edu.suda.xsap.entity.Register;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")
public interface RegisterConvert {
    @Mapping(source="name", target = "name")
    @Mapping(source="password", target = "password")
    @Mapping(source="phone", target = "phone")
    @Mapping(source ="sex", target = "sex")
    RegisterDto toDto(Register register);

    List<RegisterDto> toDtoList(List<Register> registers);
}
